<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <title>系统</title>
  <!-- Tell the browser to be responsive to screen width -->
  <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
    <meta HTTP-EQUIV="Cache-Control" CONTENT="no-cache">
    <meta HTTP-EQUIV="Expires" CONTENT="0">
  <link rel="stylesheet" href="static/css/bootstrap.min.css">
  <link rel="stylesheet" href="static/css/font-awesome.min.css">
  <link rel="stylesheet" href="static/css/AdminLTE.min.css">
  <!-- AdminLTE Skins. Choose a skin from the css/skins
       folder instead of downloading all of them to reduce the load. -->
  <link rel="stylesheet" href="static/css/all-skins.min.css">
  <link rel="stylesheet" href="static/css/main.css">
  <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
  <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
  <!--[if lt IE 9]>
  <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
  <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
  <![endif]-->
    <style>
        h1{
            font-family: "Microsoft YaHei", "微软雅黑";
            color: #ffffff;
            font-weight: bold;
            font-size: 40px;
            letter-spacing: 8px;
        }
        .form-control{
            height: 50px;
            padding: 0;
            border: 0;
        }
        .has-feedback .form-control{
            padding-right: 10px;
        }
        .form-group{
            position: relative;
            margin-bottom: 20px;
        }
        .form-group>span{
            display: inline-block;
            width: 50px;
            text-align: center;
            line-height: 30px;
            border-right: 1px solid #eaeaea;
            margin-top: 10px;
        }
        .form-group>input{
            line-height: 50px;
            padding-left: 60px;
            /*color: #cfcfcf;*/
            font-family: "Microsoft YaHei", "微软雅黑";
            border-radius: 3px;
        }
        .last-group{
            background-color: #ffffff;
            border-radius: 3px;
        }
        .last-group>input{
            padding-left: 10px;
            /*padding-right: 140px;*/
            width: 170px;
            outline: none;
            text-align: center;
        }
        .last-group>img{
            position: absolute;
            top:5px;
            right: 10px;
            height: 40px;
            padding-left: 10px;
            border-left: 1px solid #eaeaea;
        }
        @font-face {
            font-family: 'iconfont';
            src: url('./static/font/iconfont.eot');
            src: url('./static/font/iconfont.eot?#iefix') format('embedded-opentype'), url('./static/font/iconfont.woff') format('woff'), url('./static/font/iconfont.ttf') format('truetype'), url('./static/font/iconfont.svg#iconfont') format('svg');
        }

        .iconfont {
            font-family: "iconfont" !important;
            font-size: 22px;
            font-style: normal;
            -webkit-font-smoothing: antialiased;
            -webkit-text-stroke-width: 0.2px;
            -moz-osx-font-smoothing: grayscale;
            position: absolute;
            top:0;
            left: 0;
            line-height: 40px;
            color: #999999;
        }
        .row{
            border-top: 0;
        }
        .row>div>button{
            background-color: #125a8c;
            color: #ffffff;
            height: 50px;
            font-family: "Microsoft YaHei", "微软雅黑";
            font-size: 20px;
            letter-spacing: 5px;
        }
        .row>div>button:hover{
            color: #ffffff;
        }
        .row>div>.btn{
            color: #ffffff;
        }
        .row>div>.btn:hover{
            color: #ffffff;
        }
    </style>
</head>
<body class="hold-transition login-page">
<div class="login-box" id="rrapp" v-cloak>
  <div class="login-logo">
    <h1>系统登录</h1>
  </div>
  <!-- /.login-logo -->
  <div class="login-box-body">
      <!--<p class="login-box-msg">管理员登录</p>-->
      <div v-if="error" class="alert alert-danger alert-dismissible">
        <h4 style="margin-bottom: 0px;"><i class="fa fa-exclamation-triangle"></i> {{errorMsg}}</h4>
      </div>
      <div class="form-group has-feedback">
          <span class="iconfont">&#xe609;</span>
        <input type="text" class="form-control" v-model="username" placeholder="账号">
      </div>
      <div class="form-group has-feedback">
          <span class="iconfont">&#xe603;</span>
        <input type="password" class="form-control" v-model="password" placeholder="密码">
      </div>
      <div class="form-group has-feedback last-group">
          <input type="text" class="form-control" v-model="captcha" @keyup.enter="login" placeholder="输入验证码">
          <img alt="如果看不清楚，请单击图片刷新！" class="pointer" :src="src" @click="refreshCode">
      </div>
      <!--<div class="form-group has-feedback">
          <img alt="如果看不清楚，请单击图片刷新！" class="pointer" :src="src" @click="refreshCode">
          &nbsp;&nbsp;&nbsp;&nbsp;<a href="javascript:;" @click="refreshCode">点击刷新</a>
      </div>-->
      
      <div class="row">
        <!--<div class="col-xs-8">
          <div class="checkbox icheck">
          </div>
        </div>-->
        <!-- /.col -->
        <div>
          <button type="button" class="btn btn-block " @click="login">登录</button>
        </div>
        <!-- /.col -->
      </div>
    <!-- /.social-auth-links -->

  </div>
  <!-- /.login-box-body -->
</div>
<!-- /.login-box -->
<script src="static/lib/jquery.min.js"></script>
<script src="static/lib/vue.min.js"></script>
<script src="static/lib/bootstrap.min.js"></script>
<script src="static/lib/jquery.slimscroll.min.js"></script>
<script src="static/lib/fastclick.min.js"></script>
<script src="static/lib/app.js"></script>
<script type="text/javascript">
var vm = new Vue({
	el:'#rrapp',
	data:{
		username: '',
		password: '',
		error: false,
		errorMsg: '',
        captcha: '',
        src: 'captcha.do'
	},
	beforeCreate: function(){
		if(self != top){
			top.location.href = self.location.href;
		}
	},
	methods: {
        refreshCode: function(){
            this.src = "captcha.do?t=" + $.now();
        },
		login: function (event) {
            var data = "username="+vm.username+"&password="+vm.password+"&captcha="+vm.captcha;
			$.ajax({
				type: "POST",
			    url: "login.do",
			    data: data,
			    dataType: "json",
			    success: function(result){
					if(result.resultcode == 200){//登录成功
						location.href ='index.do';
					}else{
						vm.error = true;
						vm.errorMsg = result.reason;

					}
				}
			});
		}
	}
});
</script>
</body>
</html>
